
class Login extends Component{

    constructor(props) {
        super(props);
    }

    componentDidMount(){
        let userInfo= M.getUserData();
        if(userInfo!=null){
            location.hash="#/MiApiInsList";
            return
        }
        let code=M.getParameter("code")
        if(code!=null){
            //M.request.get("http://localhost:8888/a",{code})
             MIO.wxLogin({code})
        }
    }


    render(){
        return (<Row >
                <Col span={12}>
                    <iframe style={{width: '100%', height: 420, border: 'none', marginTop: 112}} src={`https://open.weixin.qq.com/connect/qrconnect?appid=${M.config.actionAppid}&redirect_uri=${location.origin}/index.html&response_type=code&scope=snsapi_login#wechat_redirect`} frameBorder="0"></iframe>
                </Col>
            </Row>)

    }
}
